<template>
  <div class="app-container">
    <router-view v-slot="{ Component }">
      <transition name="fade" mode="out-in">
        <component :is="Component" />
      </transition>
    </router-view>
    
    <van-tabbar v-model="active" route>
      <van-tabbar-item to="/" icon="home-o">
        {{ $t('nav.home') }}
      </van-tabbar-item>
      <van-tabbar-item to="/consultation" icon="chat-o">
        {{ $t('nav.consultation') }}
      </van-tabbar-item>
      <van-tabbar-item to="/appointment" icon="calendar-o">
        {{ $t('nav.appointment') }}
      </van-tabbar-item>
      <van-tabbar-item to="/rehabilitation" icon="guide-o">
        {{ $t('nav.rehabilitation') }}
      </van-tabbar-item>
      <van-tabbar-item to="/profile" icon="user-o">
        {{ $t('nav.profile') }}
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const active = ref(0)
</script>

<style lang="scss">
.app-container {
  min-height: 100vh;
  background-color: #f7f8fa;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style> 